1. Field of the Invention
The invention relates to a portable device and a system control method, and more particularly, to a portable device having a plug/unplug detector that is capable of performing a pre-defined command when the detector is actuated and a control method for performing command according to plug/unplug of the portable device.
2. Description of the Prior Art
Portable devices are commonly used to transmit and store data with a host system when plugging into the host system such as a personal computer. Taking universal serial bus (USB) storage device as an example, its hot-plug feature for the host system endows the device with extensive aspect of applications. Most host systems have specific device removal procedure for terminating all the upcoming memory access to ensure the external storage device is removed from the host system in a safe and stable way. In many situations, however, the USB storage device may be removed from the host system incautiously, whether deliberately or unintentionally. Such sudden removal of the portable device may cause immeasurable data lost or damage if transmitting is still on between the device and the host system as the removal occurs. More serious consequences may be that some critical files of the host system or the USB storage device are destroyed, leading to the unhappy result that the host system or the portable device is no longer operatible.